* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f5f5f5;
}
#select-file {
    display: block;
    width: fit-content;
    margin: 20px auto;
}
.container {
    width: 70vw;
    height: 70vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crop {
    width: 48%;
    height: 90%;
}
.crop-box {
    position: relative;
    width: 100%;
    height: 100%;
    border: 3px dashed #7b7b7b;
    border-radius: 5px;
    /* background-color: #d1adad; */
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}
.crop-preview-img {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    /* border: 1px solid #f71111; */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.mask {
    display: none;
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.49);
}
.crop-viewport-img {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    /* border: 1px solid #f71111; */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    clip-path: polygon(0 10px, 200px 10px, 200px 200px, 0 200px);
}
.crop-viewport {
    position: absolute;
    width: 300px;
    height: 300px;
    /* top: 50%;
    left: 50%; */
    /* transform: translate(-50%, -50%); */
    /* background-color: rgba(221, 211, 64, 0.655); */
}
.preview-box {
    width: 48%;
    height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* background-color: rgba(6, 66, 101, 0.432); */
}
.preview-box img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.upload {
    display: block;
    margin: 1vh auto;
    padding: 1rem 4rem;
    border: none;
    border-radius: 10px;
    letter-spacing: 0.2rem;
    background-color: #04409a;
    color: #fff;
}

/*  ----------- 
    拖拽调整元素大小
    -----------      */

/* 四条边可拖动区域 */
.edge {
    display: block;
    position: absolute;
    z-index: 10;
    /* background-color: #febc2e; */
}

.edge-bottom {
    width: 100%;
    height: 6px;
    bottom: -2px;
}

.edge-top {
    width: 100%;
    height: 6px;
    top: -2px;
}

.edge-left {
    height: 100%;
    width: 6px;
    left: -2px;
    top: 0;
}

.edge-right {
    height: 100%;
    width: 6px;
    right: -2px;
    top: 0;
}

/* 鼠标悬停时改变鼠标样式 */
.edge-top:hover,
.edge-bottom:hover {
    cursor: ns-resize;
}
.edge-left:hover,
.edge-right:hover {
    cursor: ew-resize;
}

/* 四边角 */

.corner {
    display: block;
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 11;
    /* background-color: #1c0abe; */
}

.corner-lt {
    top: -2px;
    left: -2px;
}

.corner-lb {
    bottom: -2px;
    left: -2px;
}

.corner-rt {
    top: -2px;
    right: -2px;
}

.corner-rb {
    bottom: -2px;
    right: -2px;
}

.corner-lt:hover,
.corner-rb:hover {
    cursor: nwse-resize;
}
.corner-rt:hover,
.corner-lb:hover {
    cursor: nesw-resize;
}
